package com.cmower.baeldung.string1;

import org.apache.commons.lang3.StringUtils;

public class CountStringDemo {
    public static void main(String[] args) {
String someString = "chenmowanger";
char someChar = 'e';
int count = 0;

for (int i = 0; i < someString.length(); i++) {
    if (someString.charAt(i) == someChar) {
        count++;
    }
}
System.out.println(count);

         long count1 = someString.chars().filter(ch -> ch == 'e').count();

        int count2 = StringUtils.countMatches("chenmowanger", "e");
    }
}
